import qs from 'qs'

const parseQueryFactory = (options) => async (ctx, next) => {
  ctx.query = qs.parse(ctx.querystring, options)
  await next()
}

module.exports = parseQueryFactory
